<?php

if (!defined("PHPUnit_MAIN_METHOD")) {
    define("PHPUnit_MAIN_METHOD", "RoomBookingDAOTest::main");
}

require_once "PHPUnit/Framework/TestCase.php";
require_once "PHPUnit/Framework/TestSuite.php";

/* dependencies for EE */
global $REGX, $PREFS, $DB, $GBL, $IN, $EXT, $FNS, $LOC, $LANG, $SESS, $DSP, $OUT, $BM;

include_once "systempath.php";
print("SYSTEM PATH: $system_path\n\n");//TMP

if(empty($system_path)) // couldn't read the include file
{
	if (eregi("win", PHP_OS)) 
	{
		$system_path = "c:/NCEIntranet/build/Intranet/system/";    
	}
	else
	{
		$system_path = "/var/www/ee/intranet_webdev/system/";
	}
}

$tmp = $system_path;

$ext = ".php";
define("EXT", $ext); // needed for the module class to load

require_once $system_path."config.php";

ob_start();
require_once $system_path."core/core.system.php";
ob_end_clean();

$DB = new DB($db_config);
$LANG->fetch_language_file('ncb_rooms');

require_once "RoomBooking.php";
require_once "RoomBookingDAO.php";

class RoomBookingDAOTest extends PHPUnit_Framework_TestCase {

	public static function main()
	{
		require_once "PHPUnit/TextUI/TestRunner.php";
		$suite  = new PHPUnit_Framework_TestSuite("RoomBookingDAOTest");
		$result = PHPUnit_TextUI_TestRunner::run($suite);
	}

	var $room_booking_DAO = null;

	protected function setUp()
	{
		$this->room_booking_DAO = new RoomBookingDAO();
	}

	protected function tearDown()
	{
		$this->room_booking_DAO = null;
	}

	function test_create(){
		$rb = new RoomBooking();
		$this->room_booking_DAO->create($rb);
	}
	 
}

if (PHPUnit_MAIN_METHOD == "RoomBookingDAOTest::main") {
    RoomBookingDAOTest::main();
}
?>
